package com.example.day09_7_9_2.presenter;

import android.util.Log;

import com.example.day09_7_9_2.CallBack;
import com.example.day09_7_9_2.base.BasePresenter;
import com.example.day09_7_9_2.bean.DataBean;
import com.example.day09_7_9_2.model.MModel;
import com.example.day09_7_9_2.view.MView;

public class MPresenter extends BasePresenter<MView> {

    private MModel mModel;

    public void getData() {
        Log.i("TAG", "getData: mPresenter");
        mModel.getData(new CallBack<DataBean>() {
            @Override
            public void succeed(DataBean dataBean) {
                view.succeed(dataBean);
            }

            @Override
            public void failed(String error) {
                Log.d("TAG", "failed: " + error);
            }
        });
    }

    @Override
    public void initModel() {
        mModel = new MModel();
        addModel(mModel);
    }

}
